{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "KoeGA1N7R8G6"
   },
   "source": [
    "# Praison AI Real Estate Chatbot"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "cwsqbQF0SAcR"
   },
   "source": [
    "Interact with a real estate AI assistant powered by PraisonAI and OpenAI.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "BH0Y-SB9UjNZ"
   },
   "source": [
    "[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/DhivyaBharathy-web/PraisonAI/blob/main/examples/cookbooks/Praison_AI_Real_Estate_Chatbot.ipynb)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "M4lyScgcSIFX"
   },
   "source": [
    "## 1. Install Dependencies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "p0UqhMK9TMLx"
   },
   "outputs": [],
   "source": [
    "!pip install praisonaiagents openai"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "XjtPizGWSRuh"
   },
   "source": [
    "## 2. Set Your OpenAI API Key"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "id": "FTzcJ7JTTPjp"
   },
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "# Enter your OpenAI API key here\n",
    "OPENAI_API_KEY = \"Enter your api key here\"  # <-- Replace with your key\n",
    "os.environ[\"OPENAI_API_KEY\"] = OPENAI_API_KEY"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "5WIQ76LQSeOT"
   },
   "source": [
    "## 3. Create the Praison AI Agent"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "id": "mJYmlRHtTW59"
   },
   "outputs": [],
   "source": [
    "from praisonaiagents import Agent\n",
    "\n",
    "praison_agent = Agent(\n",
    "    name=\"Praison Real Estate Chatbot\",\n",
    "    role=\"Answer real estate questions and provide helpful advice.\",\n",
    "    instructions=[\n",
    "        \"You are a helpful real estate assistant.\",\n",
    "        \"Answer user questions about buying, selling, or renting property.\",\n",
    "        \"Provide clear, concise, and friendly advice.\"\n",
    "    ],\n",
    "    markdown=True\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "wDOYoxf2SlSD"
   },
   "source": [
    "## 4. Chat with the Agent"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 1000,
     "referenced_widgets": [
      "caca39e23f66484e941342713956f289",
      "a9f33a0ed67440f1aee8c84ee7e71b1d",
      "bcc0387223424b45aec4212eae3aff89",
      "030f0e16572a40a7b8e100a6228030e3",
      "c91fa91cf91c4697ac28756d6bdf2c73",
      "08b05be0ee174761974bc10c1d217b53",
      "a08f3878570c48f38bfa3a097cb1e4d6",
      "58b89df2db0344fe80f29508c55b2939",
      "73ced2df95814c068150e9357692f47b",
      "9fbf91ecc93f4230beac5dfc0bf734f6"
     ]
    },
    "id": "zIyEMJJ6TZlb",
    "outputId": "817d4df6-ec88-425e-f00b-8ce6b4923e00"
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "caca39e23f66484e941342713956f289",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Text(value='', description='You:', placeholder='Type your real estate question here...')"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "030f0e16572a40a7b8e100a6228030e3",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Button(description='Ask Praison AI', style=ButtonStyle())"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a08f3878570c48f38bfa3a097cb1e4d6",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">Response generated in 1.7s</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2mResponse generated in 1.7s\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Hello! How can I assist you with your real estate needs today? Whether you have questions about buying,         <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> selling, or renting property, I'm here to help.                                                                 <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m Hello! How can I assist you with your real estate needs today? Whether you have questions about buying,         \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m selling, or renting property, I'm here to help.                                                                 \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "**Praison AI:** Hello! How can I assist you with your real estate needs today? Whether you have questions about buying, selling, or renting property, I'm here to help."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╭─ </span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8; font-weight: bold\">Agent Info</span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\"> ────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #ff9b9b; text-decoration-color: #ff9b9b; font-weight: bold\">👤 Agent:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Praison Real Estate Chatbot</span>                                                                          <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4b4b3; text-decoration-color: #b4b4b3; font-weight: bold\">Role:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Answer real estate questions and provide helpful advice.</span>                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;210;227;200m╭─\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[1;38;2;210;227;200mAgent Info\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[38;2;210;227;200m───────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;210;227;200m─╮\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;255;155;155m👤 Agent:\u001b[0m \u001b[38;2;255;229;229mPraison Real Estate Chatbot\u001b[0m                                                                          \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;180;180;179mRole:\u001b[0m \u001b[38;2;255;229;229mAnswer real estate questions and provide helpful advice.\u001b[0m                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "73ced2df95814c068150e9357692f47b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">Response generated in 6.3s</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2mResponse generated in 6.3s\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> What should I look for when buying my first home?                                                               <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m What should I look for when buying my first home?                                                               \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Buying your first home is an exciting milestone! Here are some key things to consider:                          <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span>                                                                                                                 <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 1 </span><span style=\"font-weight: bold\">Budget and Financing</span>: Determine how much you can afford by reviewing your finances and getting pre-approved  <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">   </span>for a mortgage. This will help you understand your price range and make your offer more attractive to        <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">   </span>sellers.                                                                                                     <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 2 </span><span style=\"font-weight: bold\">Location</span>: Consider the neighborhood and its proximity to work, schools, public transportation, and amenities <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">   </span>like shopping and parks. Also, research the area's safety and future development plans.                      <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 3 </span><span style=\"font-weight: bold\">Home Type and Size</span>: Decide what type of home suits your needs—single-family, townhouse, condo, etc. Consider <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">   </span>the number of bedrooms and bathrooms you need now and in the future.                                         <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 4 </span><span style=\"font-weight: bold\">Condition of the Property</span>: Look at the age and condition of the home. Be aware of potential repairs or       <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">   </span>renovations needed. A home inspection can help identify any major issues.                                    <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 5 </span><span style=\"font-weight: bold\">Resale Value</span>: Consider the potential resale value of the home. Factors like location, school districts, and  <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">   </span>neighborhood development can impact future value.                                                            <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 6 </span><span style=\"font-weight: bold\">Lifestyle Needs</span>: Think about your lifestyle and how the home fits into it. Consider things like yard space,  <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">   </span>commute times, and community amenities.                                                                      <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 7 </span><span style=\"font-weight: bold\">Homeowners Association (HOA)</span>: If applicable, understand the rules, fees, and restrictions of the HOA. This   <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">   </span>can impact your living experience and costs.                                                                 <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 8 </span><span style=\"font-weight: bold\">Future Growth</span>: Consider your long-term plans. Will the home accommodate potential family growth or changes   <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">   </span>in your lifestyle?                                                                                           <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span>                                                                                                                 <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Taking the time to consider these factors will help you make a well-informed decision. Good luck with your home <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> search! If you have more questions, feel free to ask.                                                           <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m Buying your first home is an exciting milestone! Here are some key things to consider:                          \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m                                                                                                                 \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m 1 \u001b[0m\u001b[1mBudget and Financing\u001b[0m: Determine how much you can afford by reviewing your finances and getting pre-approved  \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m   \u001b[0mfor a mortgage. This will help you understand your price range and make your offer more attractive to        \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m   \u001b[0msellers.                                                                                                     \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m 2 \u001b[0m\u001b[1mLocation\u001b[0m: Consider the neighborhood and its proximity to work, schools, public transportation, and amenities \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m   \u001b[0mlike shopping and parks. Also, research the area's safety and future development plans.                      \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m 3 \u001b[0m\u001b[1mHome Type and Size\u001b[0m: Decide what type of home suits your needs—single-family, townhouse, condo, etc. Consider \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m   \u001b[0mthe number of bedrooms and bathrooms you need now and in the future.                                         \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m 4 \u001b[0m\u001b[1mCondition of the Property\u001b[0m: Look at the age and condition of the home. Be aware of potential repairs or       \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m   \u001b[0mrenovations needed. A home inspection can help identify any major issues.                                    \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m 5 \u001b[0m\u001b[1mResale Value\u001b[0m: Consider the potential resale value of the home. Factors like location, school districts, and  \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m   \u001b[0mneighborhood development can impact future value.                                                            \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m 6 \u001b[0m\u001b[1mLifestyle Needs\u001b[0m: Think about your lifestyle and how the home fits into it. Consider things like yard space,  \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m   \u001b[0mcommute times, and community amenities.                                                                      \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m 7 \u001b[0m\u001b[1mHomeowners Association (HOA)\u001b[0m: If applicable, understand the rules, fees, and restrictions of the HOA. This   \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m   \u001b[0mcan impact your living experience and costs.                                                                 \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m 8 \u001b[0m\u001b[1mFuture Growth\u001b[0m: Consider your long-term plans. Will the home accommodate potential family growth or changes   \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m \u001b[1;33m   \u001b[0min your lifestyle?                                                                                           \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m                                                                                                                 \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m Taking the time to consider these factors will help you make a well-informed decision. Good luck with your home \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m search! If you have more questions, feel free to ask.                                                           \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "**Praison AI:** Buying your first home is an exciting milestone! Here are some key things to consider:\n",
       "\n",
       "1. **Budget and Financing**: Determine how much you can afford by reviewing your finances and getting pre-approved for a mortgage. This will help you understand your price range and make your offer more attractive to sellers.\n",
       "\n",
       "2. **Location**: Consider the neighborhood and its proximity to work, schools, public transportation, and amenities like shopping and parks. Also, research the area's safety and future development plans.\n",
       "\n",
       "3. **Home Type and Size**: Decide what type of home suits your needs—single-family, townhouse, condo, etc. Consider the number of bedrooms and bathrooms you need now and in the future.\n",
       "\n",
       "4. **Condition of the Property**: Look at the age and condition of the home. Be aware of potential repairs or renovations needed. A home inspection can help identify any major issues.\n",
       "\n",
       "5. **Resale Value**: Consider the potential resale value of the home. Factors like location, school districts, and neighborhood development can impact future value.\n",
       "\n",
       "6. **Lifestyle Needs**: Think about your lifestyle and how the home fits into it. Consider things like yard space, commute times, and community amenities.\n",
       "\n",
       "7. **Homeowners Association (HOA)**: If applicable, understand the rules, fees, and restrictions of the HOA. This can impact your living experience and costs.\n",
       "\n",
       "8. **Future Growth**: Consider your long-term plans. Will the home accommodate potential family growth or changes in your lifestyle?\n",
       "\n",
       "Taking the time to consider these factors will help you make a well-informed decision. Good luck with your home search! If you have more questions, feel free to ask."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import ipywidgets as widgets\n",
    "from IPython.display import display, Markdown\n",
    "\n",
    "def ask_agent(question):\n",
    "    # Use the .chat() method for the public praisonaiagents package\n",
    "    response = praison_agent.chat(question)\n",
    "    display(Markdown(f\"**Praison AI:** {response}\"))\n",
    "\n",
    "question = widgets.Text(\n",
    "    value='',\n",
    "    placeholder='Type your real estate question here...',\n",
    "    description='You:',\n",
    "    disabled=False\n",
    ")\n",
    "button = widgets.Button(description=\"Ask Praison AI\")\n",
    "\n",
    "def on_button_clicked(b):\n",
    "    ask_agent(question.value)\n",
    "\n",
    "button.on_click(on_button_clicked)\n",
    "display(question, button)"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3",
   "name": "python3"
  },
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
